var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (n, e) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, n) {
              t.__proto__ = n;
            }) ||
          function (t, n) {
            for (var e in n)
              Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
          })(n, e);
      };
      return function (n, e) {
        function o() {
          this.constructor = n;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        t(n, e),
          (n.prototype =
            null === e
              ? Object.create(e)
              : ((o.prototype = e.prototype), new o()));
      };
    })(),
  AXTaoYuanSureDialog = (function (t) {
    function n() {
      var n = t.call(this) || this;
      return (
        n.btn_sure.on(Laya.Event.CLICK, n, n.onSureBtn),
        n.btn_cancel.on(Laya.Event.CLICK, n, n.onCancelBtn),
        n
      );
    }
    return (
      __extends(n, t),
      (n.showDialog = function (t) {
        null == this.instance && (this.instance = new n()),
          (this.instance.action = t),
          this.instance.init(),
          this.instance.popup();
      }),
      (n.prototype.init = function () {
        var t = this.action;
        (this.labl_alert.text = t.msg),
          (this.label_title.text = t.title),
          t.okText
            ? (this.btn_sure.label = t.okText)
            : (this.btn_sure.label = "同意"),
          t.cancelText
            ? (this.btn_cancel.label = t.cancelText)
            : (this.btn_cancel.label = "取消");
      }),
      (n.prototype.onSureBtn = function () {
        Laya.stage.event(this.action.from, this.action.code), this.close();
      }),
      (n.prototype.onCancelBtn = function () {
        Laya.stage.event(this.action.from, this.action.cancelCode),
          this.close();
      }),
      n
    );
  })(ui.SquareController.AXTaoYuanSureDialogUI);
